package cn.jsj.dispose;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 修改律师信息处理类
 * @author LI
 *
 */
public class ModifyLawyerInfo extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		 //调试信息
		cn.jsj.utils.SysLogger.PrintInfo("进入修改律师信息处理类");
		
		//获取修改后的信息
		String lawyerId=request.getParameter("lawyerid").trim();
		String lawyerName=request.getParameter("lawyername").trim();
		String birthTime=request.getParameter("birthtime").trim();
		String lawyerSex=request.getParameter("lawyersex").trim();
		String politicalStatus=request.getParameter("politicalstatus").trim();
		String businessNumber=request.getParameter("businessnumber").trim();
		String honestArchives=request.getParameter("honestarchives").trim();
		String lawyerPhone=request.getParameter("lawyerphone").trim();
		String educationalLevel=request.getParameter("educationallevel").trim();
		String identityNumber=request.getParameter("identitynumber").trim();
		String annSurRegInfo=request.getParameter("annsurreginfo").trim();
		String positionName=request.getParameter("positionname").trim();
		String graduateSchool=request.getParameter("graduateschool").trim();
		String lawyerEmail=request.getParameter("lawyeremail").trim();
		
		 //调试信息
		cn.jsj.utils.SysLogger.PrintInfo("获得的参数为----->"+lawyerName+lawyerId+birthTime);
		//新建律师对象
		cn.jsj.pojo.TblLawyer modifyLawyer=new cn.jsj.pojo.TblLawyer();
		modifyLawyer.setLawyerId(Integer.parseInt(lawyerId));
		modifyLawyer.setLawyerName(lawyerName);
		modifyLawyer.setBirthTime(cn.jsj.utils.TimeDispose.transferDate(birthTime));
		modifyLawyer.setLawyerSex(lawyerSex);
		modifyLawyer.setPoliticalStatus(politicalStatus);
		modifyLawyer.setBusinessNumber(businessNumber);
		modifyLawyer.setHonestArchives(honestArchives);
		modifyLawyer.setLawyerPhone(lawyerPhone);
		modifyLawyer.setEducationalLevel(educationalLevel);
		modifyLawyer.setIdentityNumber(identityNumber);
		modifyLawyer.setAnnSurRegInfo(annSurRegInfo);
		//根据职位名获得职位编号
		cn.jsj.dao.TblUtilsDAO tud=new cn.jsj.dao.TblUtilsDAO();
		int positionNumber=tud.getPositionNumber(positionName);
		modifyLawyer.setPositionName(positionNumber);
		modifyLawyer.setGraduateSchool(graduateSchool);
		modifyLawyer.setLawyerEmail(lawyerEmail);
		cn.jsj.utils.SysLogger.PrintInfo("赋值完成！！！");
		//更新修改的律师对象
		cn.jsj.dao.TblLawyerDAO tld=new cn.jsj.dao.TblLawyerDAO();
		tld.modifyLawyerInfo(modifyLawyer);
		
		//调试信息
		cn.jsj.utils.SysLogger.PrintInfo("更改完成！！！");
		
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
	}

}
